package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * PosAd entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_POSAD", uniqueConstraints = @UniqueConstraint(columnNames = "AD_NO"))
public class PosAd implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -2273534086012967590L;
	private Integer adNo;
	private String adName;
	private String adFlag;
	private String adFilePosi;
	private Integer adFileSize;
	private String adBirthday;

	// Constructors

	/** default constructor */
	public PosAd() {
	}

	/** full constructor */
	public PosAd(Integer adNo, String adName, String adFlag,
			String adFilePosi, Integer adFileSize, String adBirthday) {
		this.adNo = adNo;
		this.adName = adName;
		this.adFlag = adFlag;
		this.adFilePosi = adFilePosi;
		this.adFileSize = adFileSize;
		this.adBirthday = adBirthday;
	}

	// Property accessors

	@Id
	@Column(name = "AD_NO", unique = true, nullable = false)
	public Integer getAdNo() {
		return this.adNo;
	}

	public void setAdNo(Integer adNo) {
		this.adNo = adNo;
	}

	@Column(name = "AD_NAME", nullable = false, length = 40)
	public String getAdName() {
		return this.adName;
	}

	public void setAdName(String adName) {
		this.adName = adName;
	}

	@Column(name = "AD_FLAG", nullable = false, length = 1)
	public String getAdFlag() {
		return this.adFlag;
	}

	public void setAdFlag(String adFlag) {
		this.adFlag = adFlag;
	}

	@Column(name = "AD_FILE_POSI", nullable = false, length = 80)
	public String getAdFilePosi() {
		return this.adFilePosi;
	}

	public void setAdFilePosi(String adFilePosi) {
		this.adFilePosi = adFilePosi;
	}

	@Column(name = "AD_FILE_SIZE", nullable = false)
	public Integer getAdFileSize() {
		return this.adFileSize;
	}

	public void setAdFileSize(Integer adFileSize) {
		this.adFileSize = adFileSize;
	}

	@Column(name = "AD_BIRTHDAY", nullable = false, length = 8)
	public String getAdBirthday() {
		return this.adBirthday;
	}

	public void setAdBirthday(String adBirthday) {
		this.adBirthday = adBirthday;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof PosAd))
			return false;
		PosAd castOther = (PosAd) other;

		return ((this.getAdNo() == castOther.getAdNo()) || (this.getAdNo() != null
				&& castOther.getAdNo() != null && this.getAdNo().equals(
				castOther.getAdNo())))
				&& ((this.getAdName() == castOther.getAdName()) || (this
						.getAdName() != null && castOther.getAdName() != null && this
						.getAdName().equals(castOther.getAdName())))
				&& ((this.getAdFlag() == castOther.getAdFlag()) || (this
						.getAdFlag() != null && castOther.getAdFlag() != null && this
						.getAdFlag().equals(castOther.getAdFlag())))
				&& ((this.getAdFilePosi() == castOther.getAdFilePosi()) || (this
						.getAdFilePosi() != null
						&& castOther.getAdFilePosi() != null && this
						.getAdFilePosi().equals(castOther.getAdFilePosi())))
				&& ((this.getAdFileSize() == castOther.getAdFileSize()) || (this
						.getAdFileSize() != null
						&& castOther.getAdFileSize() != null && this
						.getAdFileSize().equals(castOther.getAdFileSize())))
				&& ((this.getAdBirthday() == castOther.getAdBirthday()) || (this
						.getAdBirthday() != null
						&& castOther.getAdBirthday() != null && this
						.getAdBirthday().equals(castOther.getAdBirthday())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getAdNo() == null ? 0 : this.getAdNo().hashCode());
		result = 37 * result
				+ (getAdName() == null ? 0 : this.getAdName().hashCode());
		result = 37 * result
				+ (getAdFlag() == null ? 0 : this.getAdFlag().hashCode());
		result = 37
				* result
				+ (getAdFilePosi() == null ? 0 : this.getAdFilePosi()
						.hashCode());
		result = 37
				* result
				+ (getAdFileSize() == null ? 0 : this.getAdFileSize()
						.hashCode());
		result = 37
				* result
				+ (getAdBirthday() == null ? 0 : this.getAdBirthday()
						.hashCode());
		return result;
	}

}